<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>推荐成交</title>
    <script type="text/javascript" src="/js/jquery.js"></script>
</head>
<body>

<div>
     <ul id="J_list">
     </ul>

</div>

<script>
    var page = 1;
    var rows = 10;
    $(function(){
        getPointsList();
    });

    function getPointsList(){
        var uid = "${uid}";
        var data = {page:page,rows:rows,uid:uid,type:2};
        var url = "/points/points_list";
        $.ajax({
            type: "POST",
            dataType: 'json',
            async: false,
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(data),
            url: url,
            success: function(res){
                if(res.code = "200"){
                    //操作
                    var list = res.data.list;
                    for(var i in list) {
                        var shtml ="<div>"+i;
                        var lists =  list[i];
                        for (var j =0;j<lists.length;j++){
                            shtml +="<li><div>"+lists[j]['user_name']+"</div>";
                            switch(lists[j]['source']){
                                case 2 : shtml +="<div>推荐成交分成</div>"; break;
                                default :shtml +="<div>推荐成交</div>"; break;
                            }
                            if(lists[j]['type'] == 1){
                                shtml +="<div>-"+lists[j]['point']+"</div>";
                            }else{
                                shtml +="<div>+"+lists[j]['point']+"</div>";
                            }
                            shtml +="<div>"+lists[j]['addtime']+"</div></li>";
                        }
                        shtml += "</div>";
                        $("#J_list").append(shtml);
                    };

                }else{
                    alert(res.msg);
                }
            },
            error: function(e){

            },
            complete: function(e){
            }
        });

    }
</script>

</body>
</html>
